﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="ShoppingCartl.ascx.cs" Inherits="UserControls_ShoppingCartl" %>
<%@ Register Assembly="GoShopping.Components" Namespace="BaseText" TagPrefix="cc1" %>
<table border="0" cellpadding="0"  width="750px" cellspacing="0" style="font-size:9pt; " >
  <tr>
     <td>
         <asp:ListView ID="lvShoppingCart" runat="server" onitemcommand="lvShoppingCart_ItemCommand" onitemdatabound="lvShoppingCart_ItemDataBound">
            <LayoutTemplate>
                <table cellpadding="2" cellspacing="5" style="width:500px ; font-size:9pt;">
                    <thead>
                        <th style="width:200px; ">商品名称</td>
                        <th>单价</th>
                        <th>数量</th>
                        <th>操作</th>
                    </thead>
                    <tbody id="itemPlaceholder" runat="server">
                    </tbody>
                    <tfoot>
                        <tr>
                            <td style=" font-size:9pt;">共计:</td>
                            <td>
                                <asp:Label ID="lblTotalPrice" runat="server" Text="Label"></asp:Label>
                            </td>
                            <td>
                                <asp:Label ID="lblTotalCount" runat="server" Text="Label"></asp:Label>
                            </td>
                            <td>
                                <asp:LinkButton ID="lblGetTotal" runat="server" Text="更新" CommandName="PrdtUpdate"></asp:LinkButton>
                            </td>
                        </tr>
                        <tr>
                            <td></td>
                            <td style="width:100px">
                                <asp:ValidationSummary ID="ValidationSummary1" runat="server" DisplayMode="SingleParagraph" />
                            </td>
                            <td align="left" style="width:100px">
                            <asp:LinkButton ID="LinkButton2" runat="server" CommandName="ConBuy">继续购物</asp:LinkButton>
                            </td>
                            <td>
                                <asp:LinkButton ID="btnBuy" runat="server" CommandArgument='<%# Eval("ItemId") %>' CommandName="PrdtBuy">结帐</asp:LinkButton>
                            </td>
                        </tr>
                    </tfoot>
                </table>
            </LayoutTemplate>
            <ItemTemplate>
                <tr>
                    <td>
                      <asp:LinkButton ID="btnPrdtName" runat="server" CommandArgument='<%# Eval("ItemId") %>' CommandName="Prdt" Text='<%# Eval("ItemName") %>'></asp:LinkButton>
                    </td>
                    <td>
                      <asp:Label ID="Label2" runat="server" Text='<%# Eval("ItemPrice") %>'></asp:Label>
                    </td>
                    <td>
                      <cc1:ZLTextBox ID="txtCount" runat="server" Width="42px" Text='<%# Eval("Count") %>' InputType="number" ShowMessage="请输入数字!"/>                               
                      <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="不能为空!" ControlToValidate="txtCount" Display="None"></asp:RequiredFieldValidator>
                      <asp:RangeValidator ID="RangeValidator1" runat="server" ErrorMessage="不能小于1!" ControlToValidate="txtCount" SetFocusOnError="true" MaximumValue="100000" MinimumValue="1" Display="None" Type="Integer"></asp:RangeValidator>
                    </td>
                    <td>
                      <asp:LinkButton ID="btnDel" runat="server" CommandArgument='<%# Eval("ItemId") %>' CommandName="PrdtDel" CausesValidation="false" >删除</asp:LinkButton>
                    </td>
                </tr>
            </ItemTemplate>
            <EmptyDataTemplate>
                <table>
                    <thead>
                    <td style="width:200px">商品名称</td>
                    <td>单价</td>
                    <td>数量</td>
                    <td>操作</td>
                    </thead>
                    <tbody>
                    <tr>
                    <td>您的购物车中没有物品！</td>
                    </tr>
                    </tbody>
                </table>
            </EmptyDataTemplate>
       </asp:ListView>
     </td>
  </tr>
</table>